﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Objects;
using Freetour.Domain.Models.AirportServices;

namespace Freetour.Domain.Persistence.Repositories.AirportService
{
    public class AirportServiceRepositoryContext : ObjectContext
    {
        public AirportServiceRepositoryContext()
            : base("name=AirportServiceContainer", "AirportServiceContainer")
        {
        }

        private ObjectSet<AirportEntity> _airports;

        public ObjectSet<AirportEntity> Airports
        {
            get
            {
                if (_airports == null)
                {
                    _airports = CreateObjectSet<AirportEntity>();
                }
                return _airports;
            }
        }

        private ObjectSet<LocationEntity> _locations;

        public ObjectSet<LocationEntity> Locations
        {
            get
            {
                if (_locations == null)
                {
                    _locations = CreateObjectSet<LocationEntity>();
                }
                return _locations;
            }
        }

        private ObjectSet<PickupOrderEntity> _pickupOrders;

        public ObjectSet<PickupOrderEntity> PickerupOrders
        {
            get
            {
                if (_pickupOrders == null)
                {
                    _pickupOrders = CreateObjectSet<PickupOrderEntity>();
                }
                return _pickupOrders;
            }
        }

        private ObjectSet<ServiceOrdererEntity> _serviceOrderers;

        public ObjectSet<ServiceOrdererEntity> ServiceOrderer
        {
            get
            {
                if (_serviceOrderers == null)
                {
                    _serviceOrderers = CreateObjectSet<ServiceOrdererEntity>();
                }
                return _serviceOrderers;
            }
        }

        private ObjectSet<ServiceRouteEntity> _serviceRoute;

        public ObjectSet<ServiceRouteEntity> ServiceRoutes
        {
            get
            {
                if (_serviceRoute == null)
                {
                    _serviceRoute = CreateObjectSet<ServiceRouteEntity>();
                }
                return _serviceRoute;
            }
        }

        private ObjectSet<ServiceTypeEntity> _serviceType;

        public ObjectSet<ServiceTypeEntity> ServiceTypes
        {
            get
            {
                if (_serviceType == null)
                {
                    _serviceType = CreateObjectSet<ServiceTypeEntity>();
                }
                return _serviceType;
            }
        }
    }
}
